import java.util.HashMap;
import java.util.Map;

/*
 * An object of this class stores the current state of power consumption of the clusters. The
 * information is retrieved from the feed and interpreted and then stored into an
 * object of this class. That object is then shared around the whole program, so that
 * the same information regarding power usage is available throughout.
 * 
 * 		For the Map : Key - Resource ID (Integer)
 * 					  Value - Resource's current power usage (Double)
 */

public class SystemPowerState
{
	private Map<Integer,Double> powerValueMap = null;
	
	public SystemPowerState() 
	{
		powerValueMap = new HashMap<Integer,Double>();
	}
	
	public void setValue(int key,double value)
	{
		powerValueMap.put(new Integer(key), value);
	}
	
	public double getValue(int key)
	{
		return powerValueMap.get(new Integer(key));
	}
	
	public int getResourceNumber()
	{
		return powerValueMap.size();
	}
}
